package com.zheng.bean;


import com.zheng.api.TestService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Component
public class ConsumerComponent {

    @Reference
    private TestService testService;

    private ExecutorService executorService=Executors.newFixedThreadPool(100);

    public void run(){

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                testService.testA();

            }
        });

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                testService.testB();
            }
        });

        executorService.execute(new Runnable() {
            @Override
            public void run() {
                testService.testC();
            }
        });

    }

}
